﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KingerRobot.MexicoSailunMDC.Spi;

public interface IEmsPickService
{
    //int CreateTask(int taskNo, long locId);

    ///// <summary>
    ///// 获取可以执行的任务的信息
    ///// </summary>
    //EmsTaskBean GetTaskBean(long locId1, long locId2, int singleWorkableNo, DitchConfig ditchConfig);

    ///// <summary>
    ///// 获取指定排的配置信息
    ///// </summary>
    //DitchConfig GetDitchConfig(int ditchId);
    ///// <summary>
    ///// 执行任务
    ///// </summary>
    //int ExecuteTask(int taskANo, int taskBNo, long equipAId, long equipBId);
    ///// <summary>
    ///// 根据设备获取指令信息
    ///// </summary>
    ///// <param name="equipId1"></param>
    ///// <param name="equipId2"></param>
    ///// <returns></returns>
    //int GetExcutedTaskCmdCountByEquipId(long equipId1, long equipId2);

    ///// <summary>
    ///// 完成任务
    ///// </summary>
    //int FinishTask(int taskANo, int taskBNo);
    /// <summary>
    /// 更新scada的状态信息
    /// </summary>
    void FlushCuringScadaStatus();
}

public class EmsTaskBean
{
    public bool CanExecute { get; set; }
    public string Error { get; set; }

    public int SingleDoubleFlag { get; set; }

    public int TaskANo { get; set; }
    public int TaskAPickStation { get; set; }
    public int TaskAPickHeight { get; set; }
    public int TaskASize { get; set; }
    public int TaskAPutStation { get; set; }
    public int TaskAPutHeight { get; set; }

    public int TaskBNo { get; set; }
    public int TaskBPickStation { get; set; }
    public int TaskBPickHeight { get; set; }
    public int TaskBSize { get; set; }
    public int TaskBPutStation { get; set; }
    public int TaskBPutHeight { get; set; }

    public static EmsTaskBean Create(string error)
    {
        return new EmsTaskBean()
        {
            CanExecute = false,
            Error = error
        };
    }
}

public class DitchConfig
{
    /// <summary>
    /// 取胎位最大高度
    /// </summary>
    public int EmsPickMaxHeight { get; set; }
    /// <summary>
    /// 放胎位最大高度
    /// </summary>
    public int EmsPutMaxHeight { get; set; }
    /// <summary>
    /// 胎高
    /// </summary>
    public int TireHeight { get; set; }
}
